package ua.yandex.prodcons.threads;

public class Consumer implements Runnable {

    private CircularBuffer queue;
    private int msgCount;

    public Consumer(CircularBuffer queue,
            int msgCount) {
        this.queue = queue;
        this.msgCount = msgCount;
    }

    @Override
    public void run() {
        long num = Thread.currentThread().getId();
        try {
            for (int i = 0; i < msgCount; i++) {
                String res = queue.remove();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
